#include "stdio.h"
int main(int argc, const char **argv) {
  // default falldown size
  int size = 4;
  if (argc > 1) {
    sscanf(argv[1], "%d", &size);
    if (size < 0) {
      printf("using default size %d...\n", size);
      size = 4;
    }
  }
  int max = size * (size + 1) / 2 + 1;
  for (int i = 0; i < size; i++) {
    for (int j = 0; j <= i; j++) {
      int delta = i - j;
      int target = size - delta;
      int value = max - target * (target + 1) / 2 + j;
      printf("%d\t", value);
    }
    printf("\n");
  }
  return 0;
}
